package com.example.styrepositories.repositories;

import com.alibaba.dubbo.config.annotation.Reference;


import com.example.stymodel.model.Apple;
import com.example.styrepositories.irepoisitories.IAppleRepository;
import com.example.styrepositories.mapper.AppleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wcq
 * mysql增删改查测试
 */
@Repository
public class AppleRepository implements IAppleRepository {
    @Autowired
    AppleMapper appleMapper;

    public void insert(Apple apple) {
        appleMapper.insert(apple);

    }
    public void update(Apple apple) {
        appleMapper.update(apple);
    }


    public void delete(Integer id) {
        appleMapper.delete(id);
    }
    public List<Apple> selectAll() {
        return appleMapper.selectAll();

    }
    public Apple selectOne(Integer id) {
        return appleMapper.selectOne(id);
    }
}
